package com.cup.plat.demo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cup.plat.demo.mapper.TenantsMapper;
import com.cup.plat.demo.model.TenantModel;
import com.cup.plat.demo.service.TenantsService;

@Service
public class TenantsServiceImpl implements TenantsService {
	
	@Autowired
	private TenantsMapper tenantsMapper;
	
	@Override
	public List<TenantModel> findAll() {
		return tenantsMapper.selectList(new QueryWrapper<TenantModel>());
	}

	@Override
	public TenantModel findByTenantId(String tenantId) {
		return tenantsMapper.selectById(tenantId);
	}

	@Override
	public List<TenantModel> getTenantByXml() {
		return tenantsMapper.getTenantByXml();
	}

	@Override
	public int insert(TenantModel model) {
		return tenantsMapper.insert(model);
	}

	@Override
	public int update(TenantModel model) {
		return tenantsMapper.updateById(model);
	}

}
